import {TravelModel} from "../../../../models/travel";

const travelModel=new TravelModel();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    hotCities:Array,
    cities:Object
  },
  ready:function(){
    this.setData({
      hotCitiesData:this.properties.hotCities,
      citiesData:this.properties.cities,
      scrollTop:500
    })
  },
  /**
   * 组件的初始数据
   */
  data: {
    scrollTop:-1,
    scrollHeight:0,
    hotCitiesData:[],
    citiesData:{}
  },

  /**
   * 组件的方法列表
   */
  methods: {
    changeCity:function(event) {
      const city=event.currentTarget.dataset.city;
      travelModel.setSelectedCity(city);
      wx.navigateBack()
    },
    scroll:function(event) {
      console.log(event);
    }
  }
})
